<template>
  <div class="common-prop">
    <div class="kw-form-item">
        <div class="kw-form-item-label">
            <span>类型：</span>
            <span>{{setting.type}}</span>
        </div>
    </div>
    <input-prop :setting="setting" :config="config['id']" 
        @on-change="(v) => {handlerPropChange('id', v)}">
    </input-prop>
  </div>
</template>

<script>
import { CHANGE_COMPONENT_EVENT } from '../common/event'
export default {
    name: 'common-prop',
    props: {
        setting: {},
        config: {}
    },
    data() {
        return {
            
        }
    },
    methods: {
        handlerPropChange(prop, value) {
            let obj = Object.assign(this.setting)
            obj[prop] = value
            this.$root.EventBus.$emit(CHANGE_COMPONENT_EVENT, obj)
        }
    }
}
</script>

<style>

</style>